home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
334_02
/
regis.trm
< prev
next >
Wrap
Text File
|
1991-02-04
|
3KB
|
142 lines
/* GNUPLOT - regis.trm */
/*
* Copyright (C) 1990
*
* Permission to use, copy, and distribute this software and its
* documentation for any purpose with or without fee is hereby granted,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation.
*
* Permission to modify the software is granted, but not the right to
* distribute the modified code. Modifications are to be distributed
* as patches to released version.
*
* This software is provided "as is" without express or implied warranty.
*
* This file is included by ../term.c.
*
* This terminal driver supports:
* REGIS devices
*
* AUTHORS
* Colin Kelley, Thomas Williams
*
* send your comments or suggestions to (pixar!info-gnuplot@sun.com).
*
*/
#define REGISXMAX 800
#define REGISYMAX 440
#define REGISXLAST (REGISXMAX - 1)
#define REGISYLAST (REGISYMAX - 1)
#define REGISVCHAR 20
#define REGISHCHAR 9
#define REGISVTIC 8
#define REGISHTIC 6
int REGISang = 0;
REGISinit()
{
fprintf(outfile,"\033[r\033[24;1H");
/* 1 2
1. reset scrolling region
2. locate cursor on bottom line
*/
}
/* thanks to calmasd!dko (Dan O'Neill) for adding S(E) for vt125s */
REGISgraphics()
{
fprintf(outfile,"\033[2J\033P1pS(C0)S(E)");
/* 1 2 3 4 5
1. clear screen
2. enter ReGIS graphics
3. turn off graphics diamond cursor
4. clear graphics screen
*/
(void) REGIStext_angle(0); /* select text size and angle */
}
REGIStext()
{
fprintf(outfile,"\033\\\033[24;1H");
/* 1 2
1. Leave ReGIS graphics mode
2. locate cursor on last line of screen
*/
}
REGISlinetype(linetype)
int linetype;
{
/* This will change color in order G,R,B,G-dot,R-dot,B-dot */
static int in_map[9 + 2] = {2, 2, 3, 2, 1, 3, 2, 1, 3, 2, 1};
static int lt_map[9 + 2] = {1, 4, 1, 1, 1, 4, 4, 4, 6, 6, 6};
if (linetype >= 9)
linetype %= 9;
fprintf(outfile, "W(I%d)", in_map[linetype + 2]);
fprintf(outfile, "W(P%d)", lt_map[linetype + 2]);
}
REGISmove(x,y)
int x,y;
{
fprintf(outfile,"P[%d,%d]",x,REGISYLAST-y,x,REGISYLAST-y);
}
REGISvector(x,y)
int x,y;
{
fprintf(outfile,"v[]v[%d,%d]",x,REGISYLAST - y);
/* the initial v[] is needed to get the first pixel plotted */
}
/* put_text and text_angle by rjl */
REGISput_text(x,y,str)
int x, y;
char *str;
{
if (REGISang==1)
REGISmove(x-REGISVCHAR/2-1,y);
else
REGISmove(x,y+REGISVCHAR/2-1);
(void) putc('T',outfile); (void) putc('\'',outfile);
while (*str) {
(void) putc(*str,outfile);
if (*str == '\'')
(void) putc('\'',outfile); /* send out another one */
str++;
}
(void) putc('\'',outfile);
}
int REGIStext_angle(ang)
int ang;
{
REGISang = ang;
if (ang == 1)
fputs("T(D90,S1)",outfile);
else
fputs("T(D0,S1)",outfile);
return TRUE;
}
REGISreset()
{
fprintf(outfile,"\033[2J\033[24;1H");
}